package com.zsy.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.sql.Timestamp;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

@AllArgsConstructor
@NoArgsConstructor
@Data
public class ContractUser {
    //合同门户id
    private Integer ContractPortalId;
    //合同名称
    private String ContractName;
    //合同编号
    private String ContractNumber;
    //负责人
    private String PersonInCharge;
    //客户名称
    private String CustomerName;
    //创建日期
    private Timestamp founder;
    //合同金额
    private Integer ContractPrice;
    //合同状态
    private String ContractStatus;
    //是否删除
    private Integer delStatus;

    //日期转换
    public String getFounder(){
        if(founder == null){
            return null;
        }else {
            LocalDateTime localDateTime = founder.toLocalDateTime();
            DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
            return localDateTime.format(dateTimeFormatter);
        }
    }

}
